{// 引入标签库 }
<tagLib name="fanwe" />
{// 加载头部公共文件 }
<include file="Public:header" />
<load href="__TMPL__ThemeFiles/Js/jquery.js" />
<div class="main">
<div class="title">
	订单状态:&nbsp;{$order.goods_status_name}
</div>
<form method='post' id="form" name="form" action="{:u('Order/update')}"  enctype="multipart/form-data">
<div class="tabItem">
<TABLE cellpadding=3 cellspacing=3 width = "100%">
	<TR class="row">
		<th class="tLeft" colspan =2>订单信息：</th>		
	</TR>	
	<TR>
		<TD class="tLeft" colspan =2>	
			<table cellpadding=0 cellspacing=0 class="dataEdit" >
				<TR>
					<TD class="tRight" >兑换商品：</TD>
					<TD class="tLeft" colspan="3">{$order.data_name}</TD>
				</TR>
				<TR>
					<TD class="tRight" >订单号：</TD>
					<TD class="tLeft" >{$order.sn}</TD>
					
					<TD class="tRight" >下单日期：</TD>
					<TD class="tLeft" >{$order.create_time|toDate}</TD>	
				</TR>
				<TR>
					<TD class="tRight" >兑换积分：</TD>
					<TD class="tLeft" >{$order.order_score}</TD>
					<TD class="tRight" >&nbsp;</TD>
					<TD class="tLeft" >&nbsp;</TD>
				</TR>
				<if condition="$goods.goods_type eq 2">
				<TR>
					<TD class="tRight" >详细地址：</TD>
					<TD class="tLeft" colspan="3">{$order.address}&nbsp;</TD>
				</TR>
				<TR>
					<TD class="tRight" >电子邮箱：</TD>
					<TD class="tLeft" >{$order.email}&nbsp;</TD>
					<TD class="tRight" >邮政编码：</TD>
					<TD class="tLeft" >{$order.zip}&nbsp;</TD>
				</TR>
				<TR>
					<TD class="tRight" >手机号码：</TD>
					<TD class="tLeft" >{$order.mobile_phone}&nbsp;</TD>
					<TD class="tRight" >固定电话：</TD>
					<TD class="tLeft" >{$order.fax_phone}&nbsp;</TD>
				</TR>
				<TR>
					<TD class="tRight" >传真号码：</TD>
					<TD class="tLeft" >{$order.fix_phone}&nbsp;</TD>
					<TD class="tRight" >ＱＱ号码：</TD>
					<TD class="tLeft" >{$order.qq}&nbsp;</TD>
				</TR>
				<TR>
					<TD class="tRight" >备注：</TD>
					<TD class="tLeft" colspan="3">{$order.memo}&nbsp;</TD>
				</TR>
				<TR>
					<TD class="tRight" >处理结果：</TD>
					<TD class="tLeft" colspan="3">
					<textarea name="adm_memo" id="adm_memo" style="width:80%; height:80px;">{$order.adm_memo}</textarea>
					</TD>
				</TR>
				<else/>
					<TD class="tRight" >发放团购券：</TD>
					<TD class="tLeft" colspan="3">
					<if condition="$order.adm_memo eq ''">
					<select name="groupBond" id="groupBond">
						<option value="">==请选择==</option>
						<foreach name="bonds" item="bond">
						<option value="{$bond.id}">{$bond.sn}</option>
						</foreach>
					</select>
					<else/>
					{$order.adm_memo}
					</if>
					</TD>
				</if>
				<if condition="$order.goods_status eq 0">
				<TR>
					<TD class="tRight" >&nbsp;</TD>
					<TD class="tLeft" colspan="3">
					<input type="hidden" name="status" value="1" />
					<input type="hidden" name="id" value="{$order.id}" />
					<input type="submit" value="完成"  class="button small" onclick="return orderCheck();">
					</TD>
				</TR>
				</if>
				<if condition="$order.goods_status eq 1">
				<TR>
					<TD class="tRight" >&nbsp;</TD>
					<TD class="tLeft" colspan="3">
					<input type="hidden" name="status" value="2" />
					<input type="hidden" name="id" value="{$order.id}" />
					<input type="submit" value="作废"  class="button small"/>
					</TD>
				</TR>
				</if>
			</TABLE>		
		</TD>	
	</TR>	
</TABLE>	
</div>
	
</FORM>
</div>
	
<script type="text/javascript">
<if condition="$vo.goods_status eq 0">
function orderCheck()
{
	var val="";
	var msg="";
	<if condition="$goods.goods_type eq 2">
	val = $("#adm_memo").val();
	msg = "处理结果不能为空";
	<else/>
	val = $("#groupBond").val();
	msg = "请设置要发放的团购券，如果没有可供选择的团购券，请到＂团购券列表＂添加";
	</if>
	
	if($.trim(val) == "")
	{
		alert(msg);
		return false;
	}
}
</if>
</script>
